package com.zaoniao.enstudy.infrastructure.convert;

import com.zaoniao.enstudy.domain.entity.User;
import com.zaoniao.enstudy.infrastructure.po.UserPo;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 用户对象转换器.
 *
 * @author llb
 */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface UserCrt {

    UserCrt INSTANCE = Mappers.getMapper(UserCrt.class);

    /**
     * po2do
     *
     * @param userPo 用户数据库实体类
     * @return 用户业务实体类
     */
    User po2do(UserPo userPo);

    /**
     * do2po
     *
     * @param user 用户业务实体类
     * @return 用户数据库实体类
     */
    UserPo do2po(User user);
}
